package cn.lg.soar.cms.biz.modules.other.model;

import cn.lg.soar.cms.biz.modules.other.entity.BlockItem;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * 页面位置内容
 * @author luguoxiang
 * @since 2023-03-19
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
@Getter
@Setter
@Accessors(chain = true)
public class BlockItemVo {

    @Schema(description = "标题")
    private String title;

    @Schema(description = "副标题")
    private String subtitle;

    @Schema(description = "封面图")
    private String coverImage;

    @Schema(description = "元数据(携带的参数，如：url、id、json)")
    private String metadata;

    public BlockItemVo(){
    }

    public BlockItemVo(BlockItem data) {
        this.title = data.getTitle();
        this.subtitle = data.getSubtitle();
        this.coverImage = data.getCoverImage();
        this.metadata = data.getMetadata();
    }

    public BlockItem toBlockItem(){
        BlockItem blockItem = new BlockItem();
        blockItem.setTitle(title);
        blockItem.setSubtitle(subtitle);
        blockItem.setCoverImage(coverImage);
        blockItem.setMetadata(metadata);
        return blockItem;
    }

}
